package com.wty.mianshi.tree;


import ch.qos.logback.core.net.SyslogOutputStream;

/**
 * 根据前序遍历和中序遍历 求
 * 先序遍历 ABDEGCF
 * 中序遍历 DBGEACF
 * 后序遍历 DGEBFCA
 *
 */
public class TreeDemo {


    //生成一颗树 然后对树进行后序遍历













    public static void main(String args[]){
        TreeIterator treeIterator=new TreeIterator();
        TreeCreator treeCreator=new TreeCreator();

        TreeNode treeNode=treeCreator.createTree("ABDEGCF","DBGEACF");
        treeIterator.postOrder(treeNode);

        treeIterator.postOrder(treeCreator.createTree("", ""));
        System.out.println();
        treeIterator.postOrder(treeCreator.createTree("A", "A"));
        System.out.println();
        treeIterator.postOrder(treeCreator.createTree("AB", "BA"));

    }
}
